package com.example.content.tab

import com.example.content.App
import com.example.content.R
import com.example.uiwidegt.tablayout.entity.TabEntity
import com.example.uiwidegt.tablayout.listener.CustomTabEntity

/**
 * Created by zhudongao
 * Desc
 * Date 2020/9/19
 */
object HomeTab {
    val titles = arrayOf(
        App.appContext.resources.getString(R.string.main_tab_home),
        App.appContext.resources.getString(R.string.main_tab_city),
        "",
        App.appContext.resources.getString(R.string.main_tab_message),
        App.appContext.resources.getString(R.string.main_tab_me)
    )

    private val icon = arrayOf(
        R.drawable.ic_home_noraml,
        R.drawable.ic_city_normal,
        R.drawable.dot,
        R.drawable.ic_msg_normal,
        R.drawable.ic_me_normal
    )

    private val icon_select = arrayOf(
        R.drawable.ic_home_select,
        R.drawable.ic_city_select,
        R.drawable.dot,
        R.drawable.ic_msg_select,
        R.drawable.ic_me_select
    )

    fun getTabEntities(): List<CustomTabEntity>{
        val entities = mutableListOf<CustomTabEntity>()
        for (index in titles.indices) {
            entities.add(TabEntity(titles[index], icon_select[index], icon[index], !titles[index].isBlank()))
        }
        return entities
    }
}